<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <a href="/storehome/" class="button">返回</a>
    <title>店铺管理</title>
</head>
<body>
    <h1>店铺信息</h1>
    {% if messages %}
        <ul class="messages">
            {% for message in messages %}
                <li {% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
            {% endfor %}
        </ul>
    {% endif %}
    {% if backend_message %}
        {% for x in backend_message %}
            <p>
                <strong>店铺id:</strong> {{ x.id }}
                <strong>店铺名称:</strong> {{ x.storename }}
                <strong>店主:</strong> {{ x.ownername }}
                <strong>店铺描述:</strong> {{ x.sdescription }}
            </p>
        {% endfor %}
    {% else %}
        <p>用户信息未找到。</p>
    {% endif %}
    <form action="/store/" method="post">
        {% csrf_token %}
        <button type="submit" name="action" value="1">创建店铺</button>
        <button type="submit" name="action" value="2">强制闭店</button>
        <button type="submit" name="action" value="3">强制修改店铺信息</button>
        <button type="submit" name="action" value="4">查询所有正常店铺信息</button>
        <div class="container mt-5">
            <h2>商店信息</h2>
            <form action="/store/" method="post">
                {% csrf_token %}
                <div class="mb-3">
                    <label for="id_email" class="form-label">id</label>
                    {{ form.id.errors }}
                    {{ form.id }}
                </div>
                <div class="mb-3">
                    <label for="id_pname" class="form-label">storename</label>
                    {{ form.storename.errors }}
                    {{ form.storename }}
                </div>
                <div class="mb-3">
                    <label for="id_tel" class="form-label">ownerid</label>
                    {{ form.ownername.errors }}
                    {{ form.ownername }}
                </div>
                <div class="mb-3">
                    <label for="id_tel" class="form-label">sdescription</label>
                    {{ form.sdescription.errors }}
                    {{ form.sdescription }}
                </div>
            </form>
        </div>
    </form>
</body>
</html>

